<include file="public:header"/>
<div class="toptip">
    <div class="toptit">提示：</div>
    <p>点击“继续添加”按钮，可同时添加多个分类！</p>
</div>

<div class="toptit">新增专业分类</div>
<form action="{:U('add')}" method="post" name="FormData">
    <div class="form_main width120">
        <div class="category_tpl">
            <div class="fl">所属分类:</div>
            <div class="fr">
                <div class="select_input_new w400 J_hoverinput J_dropdown J_listitme_parent">
                    <span class="J_listitme_text">选择分类</span>
                    <div class="dropdowbox_sn J_dropdown_menu">
                        <div class="dropdow_inner_sn">
                            <ul class="nav_box">
                                <li><a class="J_listitme <eq name='Think.get.pid' value='0'>list_sel</eq>" href="javascript:;" data-code="0">顶级分类</a></li>
                                <volist name="cate[0]" id="parent">
                                    <li><a class="J_listitme <eq name='Think.get.pid' value='$parent.id'>list_sel</eq>" href="javascript:;" data-code="{$parent.id}">{$parent.categoryname}</a></li>
                                </volist>
                            </ul>
                        </div>
                    </div>
                    <input class="J_listitme_code" name="parentid[]" id="parentid[]" type="hidden" value="" />
                </div>
                <!-- <select name="parentid[]">
                    <option value="0" <eq name='Think.get.pid' value='0'>selected="selected"</eq>>顶级分类</option>
                    <volist name="cate[0]" id="parent">
                        <option value="{$parent.id}" <eq name='Think.get.pid' value='$parent.id'>selected="selected"</eq>>{$parent.categoryname}</option>
                    </volist>
                </select> -->
            </div>
            <div class="fl">名称:</div>
            <div class="fr">
                <input name="categoryname[]" type="text" class="input_text_default middle" maxlength="20" value=""/>
            </div>
            <div class="fl">排序:</div>
            <div class="fr">
                <input name="category_order[]" type="text" class="input_text_default middle" maxlength="3" value="0" onkeyup="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))" placeholder="数字越大越靠前，默认是0"/>
                <label class="no-fl-note">(数字越大越靠前)</label>
            </div>
            <div style="width: 660px; height: 20px; border-top: 1px #DFDFDF dashed; margin-left: 60px; float: left; margin-top: 10px">&nbsp;</div>
        </div>
        <div class="continue_add"></div>
        <div class="fl"></div>
        <div class="fr">
            <input type="submit" class="admin_submit" value="保存"/>
            <input type="button" class="admin_submit" value="继续添加" id="add_more"/>
            <input type="button" class="admin_submit" value="返回" onClick="window.location='{:U('index')}'"/>
        </div>
        <div class="clear"></div>
    </div>
</form>

</div>
<include file="public:footer"/>
<script type="text/javascript" src="__ADMINPUBLIC__/js/jquery.listitem.js"></script>
<script type="text/javascript" src="__ADMINPUBLIC__/js/jquery.dropdown.js"></script>
</body>
<script type="text/javascript">
    $(document).ready(function () {
        $("#add_more").click(function()
        {
            $(".continue_add").append($(".category_tpl").html());
        });
        if ($('.J_listitme.list_sel').length) {
            var listSelCn = $.trim($('.J_listitme.list_sel').text());
            var listSelCode = $('.J_listitme.list_sel').data('code');
            $('.J_listitme.list_sel').closest('.J_listitme_parent').find('.J_listitme_text').text(listSelCn);
            $('.J_listitme.list_sel').closest('.J_listitme_parent').find('.J_listitme_code').val(listSelCode);
        }
    });
</script>
</html>